Skip to content

Conversation

@sorear
Copy link
Collaborator

@sorear sorear commented Feb 24, 2024

This reverts commit d49e480.

Both the ePIC and FDPIC ABIs are expected to define relocation types which can be used for both PC-relative and GP-relative data, and are expected to define relaxations to optimize access to both types of data. Explicit, compiler-generated relocations using GP are only useful in cases where an object is known at compile time to be local and present in the GP-relative segment. The relaxations will result in GP-relative accesses, but the relocations involved will be linker internal and need not have allocated standard numbers.

This reverts commit d49e480.

Both the ePIC and FDPIC ABIs are expected to define relocation types
which can be used for both PC-relative and GP-relative data, and are
expected to define relaxations to optimize access to both types of data.
Explicit, compiler-generated relocations using GP are only useful in
cases where an object is known at compile time to be local and present
in the GP-relative segment.  The relaxations will result in GP-relative
accesses, but the relocations involved will be linker internal and need
not have allocated standard numbers.
@sorear sorear requested a review from MaskRay February 24, 2024 23:49
Copy link
Collaborator

@MaskRay MaskRay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made extensive investigations of older solutions (-msep-data, -mid-shared-library, -mno-pic-data-is-text-relative, -fropi and -frwpi, -mfdpic; m68k/sh4/arm) and will keep adding notes to https://maskray.me/blog/2024-02-20-mmu-less-systems-and-fdpic

I agree that these GP-relative relocation types will not be useful.

With suitable optimizations and relaxations, the ePIC relocations can be completely replaced.

AFAIK, these relocation types haven't been used in any upstream projects.

@kito-cheng
Copy link
Collaborator

LGTM but I would like to merge this until #405 update :)

cc. @luismarques

@luismarques
Copy link
Collaborator

Sounds reasonable.

@MaskRay
Copy link
Collaborator

MaskRay commented Mar 3, 2024

I am now working on ARM FDPIC for LLVM+Clang to get some engineering experience. Yes, I am more convinced we should remove relocation types for direct GP-relative addressing:)

@sorear
Copy link
Collaborator Author

sorear commented Mar 29, 2024

Should I merge this, then?

Copy link
Collaborator

@kito-cheng kito-cheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let moving forward :)

@kito-cheng kito-cheng merged commit a3b57bb into master Apr 10, 2024
@kito-cheng kito-cheng deleted the revert-pr-394 branch April 10, 2024 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants